package com.sena.engine.snmp.api;

import com.sena.engine.common.exception.SenaSnmpRunTimeException;
import com.sena.engine.snmp.base.SnmpTarget;

import java.io.IOException;
import java.util.List;

/**
 * @author Admin
 */
public interface SenaSnmpApi {

    /**
     * 检查设备snmp是支持
     *
     * @param SnmpTarget
     * @throws SenaSnmpRunTimeException
     */
    boolean checkSnmpAgentActive(SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;

    /**
     * 设置mib节点的数值
     *
     * @param oid
     * @param value
     * @param var3
     * @param SnmpTarget
     * @throws SenaSnmpRunTimeException
     */
    void setOIDValue(String oid, String value, String var3, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;

    /**
     * h获取oid的值
     *
     * @param oid
     * @param SnmpTarget
     * @return
     * @throws SenaSnmpRunTimeException
     */
    String getOIDValue(String oid, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;

    /**
     * 获取Long型的oid值
     *
     * @param oid
     * @param SnmpTarget
     * @return
     * @throws SenaSnmpRunTimeException
     */
    Long getOIDLongValue(String oid, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;

    /**
     * 获取下一个节点的值
     *
     * @param oid
     * @param SnmpTarget
     * @return
     * @throws SenaSnmpRunTimeException
     */
    String getNextOIDValue(String oid, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;

    /**
     * 获取snmp组的值
     *
     * @param obj
     * @param SnmpTarget
     * @return
     * @throws SenaSnmpRunTimeException
     * @throws IOException
     */
    Object getMibObject(Object obj, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException, IOException;

    /**
     * 更新snmp数据
     *
     * @param obj
     * @param SnmpTarget
     * @throws SenaSnmpRunTimeException
     */
    void update(Object obj, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;

    /**
     * 获取全部数
     *
     * @param clazz
     * @param SnmpTarget
     * @return
     * @throws SenaSnmpRunTimeException
     */
    List getAllTableData(Class clazz, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;

    /**
     * 获取全部表格数据的值
     *
     * @param SnmpTarget
     * @param oids
     * @return
     * @throws SenaSnmpRunTimeException
     * @throws IOException
     */
    List<List<String>> getAllOIDTableData(SnmpTarget SnmpTarget, List<String> oids) throws SenaSnmpRunTimeException, IOException;

    /**
     * 更新snmp表格数据
     *
     * @param object
     * @param SnmpTarget
     * @throws SenaSnmpRunTimeException
     * @throws IOException
     */
    void addTableRow(Object object, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException, IOException;

    /**
     * 删除snmp表格数据
     *
     * @param object
     * @param SnmpTarget
     * @throws SenaSnmpRunTimeException
     */
    void delTableRow(Object object, SnmpTarget SnmpTarget) throws SenaSnmpRunTimeException;
}
